package com.apes.fn.server.reworkAppraisal.repository;


import com.apes.fn.server.reworkAppraisal.model.ReworkAppraisal;
import com.apes.fn.server.workOrder.model.MaintenanceOrder;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @Classname ReworkAppraisqlItemRepostiory
 * @Description 返修鉴定单
 * @Date 2020/1/2 14:38
 * @Created by Administrator
 */
public interface ReworkAppraisalRepository extends CustomRepository<ReworkAppraisal, String> {
    @Query(value = " SELECT S FROM MaintenanceOrder S  "
            + " WHERE S.state not  in ('termination') AND S.businessType ='common' AND S.servicePlanItem.id =:servicePlanId "
    )
    MaintenanceOrder findByServicePlanId(@Param("servicePlanId") String servicePlanId);
}
